package Client;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import Project_etow.LoginDialog;


public class ClientControl extends javax.swing.JFrame {

	private String accountid;
	private String groupname;
        public String getGroupname() {
		return groupname;
	}
	public void setGroupname(String groupname) {
		this.groupname = groupname;
	}
	public String getAccountid() {
		return accountid;
	}
	public void setAccountid(String accountid) {
		this.accountid = accountid;
	}


	public ClientControl() {
        initComponents();
    }


    @SuppressWarnings("unchecked")

    private void initComponents() {
    	btnlogout = new javax.swing.JButton();
    	btmyprofiles = new javax.swing.JButton();
        btmybill = new javax.swing.JButton();
        
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new java.awt.FlowLayout());

        btmyprofiles.setText("My Profiles");
        getContentPane().add(btmyprofiles);
        btmyprofiles.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				MyProfiles mypro = new MyProfiles(null, true,getAccountid(),getGroupname());
				mypro.setVisible(true);
				
			}
		});
       
        btnlogout.setText("LogOut");
        getContentPane().add(btnlogout);
        btnlogout.addActionListener(new ActionListener() {
            
            @Override
            public void actionPerformed(ActionEvent e) {
            
                    setVisible(false);
                    LoginDialog lg = new LoginDialog(null, true);
                    lg.setVisible(true);
                    
            }
    });
        pack();
    }

    public static void main(String args[]) {
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(ClientControl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ClientControl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ClientControl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ClientControl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }

        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new ClientControl().setVisible(true);
            }
        });
    }

    private javax.swing.JButton btmyprofiles;
    private javax.swing.JButton btmybill,btnlogout;
}

